<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>商城详情页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/css2/iconfont/iconfont.css" rel="stylesheet"/>
    <link href="/css2/common.css" rel="stylesheet"/>
    <link href="/css2/uc.css" rel="stylesheet"/>
    <link href="/layui/css/layui.css" rel="stylesheet">
</head>
<body>
<!--头部-->
<th:block th:include="header1"/>

<div class="wrapper uc-router">
    <ul>
        <li><a href="/">首页</a></li>
        <li><span class="divider"></span></li>
        <li><span>个人中心</span></li>
    </ul>
</div>

<div class="wrapper">
    <div class="uc-main clearfix">
        <div class="uc-aside">
            <div class="uc-menu">
                <div class="tit">订单中心</div>
                <ul class="sublist">
                    <li><a href="/uc-order">我的订单</a></li>
                    <li><a href="uc-fav.html">我的收藏</a></li>
                    <li><a href="uc-footprint.html">浏览历史</a></li>
                </ul>
                <div class="tit">客户服务</div>
                <ul class="sublist">
                    <li><a href="">取消订单记录</a></li>
                    <li><a href="uc-refund.html">退款/退货</a></li>
                </ul>
                <div class="tit">账户中心</div>
                <ul class="sublist">
                    <li><a href="uc-account.html">账户信息</a></li>
                    <li><a id="updatePassword">修改密码</a></li>
                    <li><a href="">消费记录</a></li>
                    <li><a href="/uc-address">收货地址</a></li>
                </ul>
                <div class="tit">消息中心</div>
                <ul class="sublist">
                    <li><a href="uc-evaluate.html">商品评价</a></li>
                    <li><a href="uc-msg.html">站内消息</a></li>
                </ul>
            </div>
        </div>
        <div class="uc-content">
            <div class="uc-panel account-panel">
                <div class="user-info">
                    <a href=""><img class="headpic" th:src="${session.currentUser.avatar}" alt="头像"/></a>
                    <div class="info">
                        <div><span class="name">[[${session.currentUser.name}]]</span><span class="wel">下午好</span>
                        </div>
                        <a href="" class="label">普通会员</a>
                        <a href="/uc-account" class="edit">修改个人信息></a>
                    </div>
                </div>
                <div class="quick-menu">
                    <div class="item">
                        <a href=""><img class="ico" src="/img/ico/uc-aq.png"/>账户安全：较高</a>
                    </div>
                    <div class="item">
                        <a href=""><img class="ico" src="/img/ico/uc-phone.png"/>绑定手机：[[${session.currentUser.tel}]]</a>
                    </div>
                    <div class="item">
                        <a href="/uc-address"><img class="ico" src="/img/ico/uc-dizhi.png"/>我的收货地址</a>
                    </div>
                    <div class="item">
                        <a href=""><img class="ico" src="/img/ico/uc-qianbao.png"/>我的钱包</a>
                    </div>
                </div>
            </div>

            <div class="uc-panel home-order">
                <div class="col">
                    <img src="/img/ico/uc-order1.png" class="ico"/>
                    <div class="bd">
                        <div class="tit">待支付的订单：<span class="num"></span></div>
                        <a class="more" href="">查看待支付订单></a>
                    </div>
                </div>
                <div class="col">
                    <img src="/img/ico/uc-order2.png" class="ico"/>
                    <div class="bd">
                        <div class="tit">待发货的订单：<span class="num"></span></div>
                        <a class="more" href="">查看待支付订单></a>
                    </div>
                </div>
                <div class="col">
                    <img src="/img/ico/uc-order3.png" class="ico"/>
                    <div class="bd">
                        <div class="tit">待收货的订单：<span class="num"></span></div>
                        <a class="more" href="">查看待支付订单></a>
                    </div>
                </div>
                <div class="col">
                    <img src="/img/ico/uc-order4.png" class="ico"/>
                    <div class="bd">
                        <div class="tit">待评价的订单：<span class="num"></span></div>
                        <a class="more" href="">查看待支付订单></a>
                    </div>
                </div>
            </div>

            <div class="uc-panel home-wuliu">
                <div class="home-wuliu-hd">
                    我的物流
                </div>
                <div class="home-wuliu-bd">
                    <div class="item">
                        <a href="" class="confirm ui-btn-theme uc-btn-md">确认收货</a>
                        <div class="cont">
                            <img src="/uploads/3.jpg" alt="" class="figure"/>
                            <div class="info">
                                <div class="status">快件已签收，感谢您使用中通快递！</div>
                                <div>
                                    <span class="time">2016-05-20  16:04:28</span>
                                    <a href="">查看物流明细</a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!--脚部-->
<div class="fatfooter">

</div>
<!--脚部-->
</body>
<script id="template3" type="text/html">
    <form class="layui-form" action="" lay-filter="form3">

        <div class="layui-form-item" style="margin-top: 15px">
            <div class="layui-inline">
                <label class="layui-form-label">原始密码</label>
                <div class="layui-input-inline layui-input-wrap">
                    <input type="hidden" name="id">
                    <input type="password" name="oldPassword" lay-verify="required|username" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">新密码</label>
                <div class="layui-input-inline layui-input-wrap">
                    <input type="password" name="newPassword" lay-verify="required" autocomplete="off" lay-affix="clear"
                           class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">再次确认新密码</label>
                <div class="layui-input-inline layui-input-wrap">
                    <input type="password" name="newPasswordAgain" lay-verify="required" autocomplete="off"
                           lay-affix="clear" class="layui-input">
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline layui-input-block">
                <input id="resetPassword" type="reset" value="重置" class="layui-btn">
                <input id="savePassword" type="button" value="保存" class="layui-btn" lay-submit lay-filter="demo-verify11">
            </div>
        </div>
    </form>
</script>
<script src="/js2/jquery.js"></script>
<link rel="stylesheet" href="/js2/icheck/style.css"/>
<script src="/js2/icheck/icheck.min.js"></script>
<script src="/js2/laydate/laydate.js"></script>
<script src="/js2/global.js"></script>
<script src="/layui/layui.js"></script>
<script>
    layui.use(['jquery', 'layer','form'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        $("#updatePassword").on("click", function () {
            layer.open({
                title: "修改密码",
                type: 1,
                area: ['400px', '400px'],
                content: $("#template3").html()
            });
            $("#savePassword").on("click", function () {
                var data = form.val("form3");
                // var password = $("#newPassword").val();
                // var reg =/^(?=.*[a-zA-Z])(?=.*\d).{1,9}$/; // 密码正则表达式
                // if (!reg.test(password)) {
                //     layer.msg("密码格式不正确");
                //     return;
                // }
                data.cmd = "UpdatePassword";
                $.post("/login/UpdatePassword", data, function (result) {//发送一个AJAX请求,参数（请求地址,请求时传递的数据,状态码200时才执行的function(即传过来的数据)）
                    if (result.code === 0) {
                        layer.closeAll();//关窗口
                        layer.msg(result.msg)//给出成功提示
                        location.reload()
                        window.location = '/login';
                    } else if (result.code === 1) {
                        layer.msg(result.msg)
                    } else if (result.code === 2) {
                        layer.msg(result.msg)
                    }
                });
            });
        });
        // 百度统计代码，只统计指定域名
    });
</script>
</html>